<?php

namespace common\models\credit_public_tables;

use Yii;

/**
 * This is the model class for table "{{%sl_check_1004}}".
 *
 * @property integer $check_id
 * @property string $c_id
 * @property string $c_name
 * @property string $c_card
 * @property string $c_bankcard
 * @property string $c_issame
 * @property integer $c_time
 * @property string $c_source
 * @property string $c_orderid
 * @property string $c_post
 * @property string $c_back
 */
class SlCheck1004 extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%sl_check_1004}}';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db_public');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['c_time'], 'integer'],
            [['c_post', 'c_back'], 'string'],
            [['c_id', 'c_card', 'c_bankcard'], 'string', 'max' => 30],
            [['c_name', 'c_issame'], 'string', 'max' => 100],
            [['c_source'], 'string', 'max' => 10],
            [['c_orderid'], 'string', 'max' => 32],
            [['c_name', 'c_card', 'c_bankcard'], 'unique', 'targetAttribute' => ['c_name', 'c_card', 'c_bankcard'], 'message' => 'The combination of 姓名, 身份证 and 银行卡号 has already been taken.'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'check_id' => Yii::t('app', '外部订单号'),
            'c_id' => Yii::t('app', '外部订单号'),
            'c_name' => Yii::t('app', '姓名'),
            'c_card' => Yii::t('app', '身份证'),
            'c_bankcard' => Yii::t('app', '银行卡号'),
            'c_issame' => Yii::t('app', '是否一致'),
            'c_time' => Yii::t('app', 'C Time'),
            'c_source' => Yii::t('app', 'C Source'),
            'c_orderid' => Yii::t('app', 'C Orderid'),
            'c_post' => Yii::t('app', 'C Post'),
            'c_back' => Yii::t('app', 'C Back'),
        ];
    }
}
